#include <iostream>
#include <cmath>
using namespace std;

int main() {
    double x,n;
    cin >> x >> n;
    double res = 0;
    for (int i = 0; i <= n; i++)
    {
        double temp = pow(x, i);
        res += temp;
    }
    printf("%.2f", res);
    
    return 0;
}